package javajichu.shuozhu.Zuoyei;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class Zy3 {
    public static void main(String[] args) {
        int p[]=new int [10];
        int sum;
        for (int i=1;i<p.length;i++) {
            p[i]=(i+1)*(i+1);
            System.out.print(" " + p[i]);
        }
        Arrays.sort(p);
        System.out.println("倒序");
        for (int i = 0; i < p.length; i++) {
            p[i] = (i + 1) * (i + 1);
            System.out.print(p[p.length - 1 - i] + " ");
        }
    }
}
